package com.chee.plant.hibernate.object.base;

import java.io.Serializable;


/**
 * This is an object that contains data related to the email table.
 * Do not modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 *
 * @hibernate.class
 *  table="email"
 */

public abstract class BaseEmail  implements Serializable {

	public static String REF = "Email";
	public static String PROP_CREATED = "Created";
	public static String PROP_OWNER_ID = "OwnerId";
	public static String PROP_TITTLE = "Tittle";
	public static String PROP_FROM_ID = "FromId";
	public static String PROP_TO_ID = "ToId";
	public static String PROP_ID = "Id";
	public static String PROP_CONTENT = "Content";


	// constructors
	public BaseEmail () {
		initialize();
	}

	/**
	 * Constructor for primary key
	 */
	public BaseEmail (java.lang.Integer id) {
		this.setId(id);
		initialize();
	}

	/**
	 * Constructor for required fields
	 */
	public BaseEmail (
		java.lang.Integer id,
		java.lang.Integer ownerId,
		java.lang.String fromId,
		java.lang.String toId,
		java.lang.String tittle,
		java.lang.String content,
		java.util.Date created) {

		this.setId(id);
		this.setOwnerId(ownerId);
		this.setFromId(fromId);
		this.setToId(toId);
		this.setTittle(tittle);
		this.setContent(content);
		this.setCreated(created);
		initialize();
	}

	protected void initialize () {}



	private int hashCode = Integer.MIN_VALUE;

	// primary key
	private java.lang.Integer id;

	// fields
	private java.lang.Integer ownerId;
	private java.lang.String fromId;
	private java.lang.String toId;
	private java.lang.String tittle;
	private java.lang.String content;
	private java.util.Date created;



	/**
	 * Return the unique identifier of this class
     * @hibernate.id
     *  generator-class="sequence"
     *  column="id"
     */
	public java.lang.Integer getId () {
		return id;
	}

	/**
	 * Set the unique identifier of this class
	 * @param id the new ID
	 */
	public void setId (java.lang.Integer id) {
		this.id = id;
		this.hashCode = Integer.MIN_VALUE;
	}




	/**
	 * Return the value associated with the column: owner_id
	 */
	public java.lang.Integer getOwnerId () {
		return ownerId;
	}

	/**
	 * Set the value related to the column: owner_id
	 * @param ownerId the owner_id value
	 */
	public void setOwnerId (java.lang.Integer ownerId) {
		this.ownerId = ownerId;
	}



	/**
	 * Return the value associated with the column: from_id
	 */
	public java.lang.String getFromId () {
		return fromId;
	}

	/**
	 * Set the value related to the column: from_id
	 * @param fromId the from_id value
	 */
	public void setFromId (java.lang.String fromId) {
		this.fromId = fromId;
	}



	/**
	 * Return the value associated with the column: to_id
	 */
	public java.lang.String getToId () {
		return toId;
	}

	/**
	 * Set the value related to the column: to_id
	 * @param toId the to_id value
	 */
	public void setToId (java.lang.String toId) {
		this.toId = toId;
	}



	/**
	 * Return the value associated with the column: tittle
	 */
	public java.lang.String getTittle () {
		return tittle;
	}

	/**
	 * Set the value related to the column: tittle
	 * @param tittle the tittle value
	 */
	public void setTittle (java.lang.String tittle) {
		this.tittle = tittle;
	}



	/**
	 * Return the value associated with the column: content
	 */
	public java.lang.String getContent () {
		return content;
	}

	/**
	 * Set the value related to the column: content
	 * @param content the content value
	 */
	public void setContent (java.lang.String content) {
		this.content = content;
	}



	/**
	 * Return the value associated with the column: created
	 */
	public java.util.Date getCreated () {
		return created;
	}

	/**
	 * Set the value related to the column: created
	 * @param created the created value
	 */
	public void setCreated (java.util.Date created) {
		this.created = created;
	}




	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof com.chee.plant.hibernate.object.Email)) return false;
		else {
			com.chee.plant.hibernate.object.Email email = (com.chee.plant.hibernate.object.Email) obj;
			if (null == this.getId() || null == email.getId()) return false;
			else return (this.getId().equals(email.getId()));
		}
	}

	public int hashCode () {
		if (Integer.MIN_VALUE == this.hashCode) {
			if (null == this.getId()) return super.hashCode();
			else {
				String hashStr = this.getClass().getName() + ":" + this.getId().hashCode();
				this.hashCode = hashStr.hashCode();
			}
		}
		return this.hashCode;
	}


	public String toString () {
		return super.toString();
	}

private static final long serialVersionUID = 1L; 
}